import axios from '../config/axiosConfig'

export const currentDeptInfo = function (pageNum, pageSizeP) {
  let currentPage = pageNum || 1;
  let pageSize = pageSizeP || 10;
  let start = (currentPage - 1) * pageSize;
  let limit = pageSize;
  return new Promise(function(resove){
    axios.post(MENUCORE_SERVICE_URL + 'indexUser/currentDeptInfo',{start: start,
      limit: limit,
      keyword:document.getElementById('#dept-search-input').value
    }).then(function (res) {
      let data = res.data;
      document.querySelectorAll('#deptLoading')[0].style.display = 'block';
      if (data.status == 'SUCCESS') {
        resove(data.body);
      }
    }).catch(function (httpRequest) {
      console.log("部门切换方法调用失败！");
    });
  });
};
